home *** CD-ROM | disk | FTP | other *** search
/ Super PC 31 / Super PC 31 (Shareware).iso / spc / inter / speakf / fuente / lpc / lpctest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-07  |  594 b   |  31 lines

  1. #include <stdio.h>
  2. #include "lpc.h"
  3.  
  4. /*#define ENCODE/**/
  5. /*#define DECODE/**/
  6.  
  7. main(argc, argv)
  8.   int argc;
  9.   char **argv;
  10. {
  11.   int nbytes;
  12.   unsigned char buf[180];
  13.   lpcparams_t params;
  14.  
  15. fprintf(stderr, "S = %d\n", sizeof params);
  16.   lpc_init(sizeof(buf));
  17. #ifndef DECODE
  18.   while ((nbytes = read(0, buf, sizeof(buf))) > 0) {
  19.     lpc_analyze(buf, ¶ms);
  20. #else
  21.   while ((nbytes = read(0, ¶ms, sizeof(params))) > 0) {
  22. #endif
  23. #ifdef ENCODE
  24.     write(1, ¶ms, sizeof params);
  25. #else
  26.     nbytes = lpc_synthesize(¶ms, 1.0, buf);
  27.     write(1, buf, nbytes);
  28. #endif
  29.   }
  30. }
  31.